package com.wantong.jianpu.models;

import com.trello.rxlifecycle2.LifecycleProvider;
import com.wantong.jianpu.beans.LocationBean;
import com.wantong.jianpu.beans.LoginBean;
import com.wantong.jianpu.net.BaseObserver;
import com.wantong.jianpu.net.HttpUtils;
import com.wantong.jianpu.net.RetrofitUtil;

import java.util.List;
import java.util.Map;

import io.reactivex.Observable;
import me.goldze.mvvmhabit.base.BaseModel;

/**
 * @author PACY
 * @date 2022/5/23
 * description:
 */
public class LocationModel extends BaseModel {
    /**
     *  查询位置树
     * @param observer
     * @param lifecycle
     */
    public void location(BaseObserver<List<LocationBean>> observer, LifecycleProvider lifecycle) {
        Observable observable = RetrofitUtil.getApiService().locationTree();
        RetrofitUtil.composeToSubscribe(observable, observer, lifecycle);
    }

    /**
     *  查询巡查区域
     * @param observer
     * @param lifecycle
     */
    public void getInspectionLocation(BaseObserver<List<LocationBean>> observer, LifecycleProvider lifecycle) {
        Observable observable = RetrofitUtil.getApiService().getInspectionLocation();
        RetrofitUtil.composeToSubscribe(observable, observer, lifecycle);
    }
}
